package com.wj.service.communication;

import com.wj.vo.JwtToken;
import com.wj.vo.UsernameAndPassword;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 *  与 Authority 通信服务的 Feign Client 接口定义
 */
@FeignClient(contextId = "AuthorityFeignClient", value = "wj-code-authority-center")
public interface AuthorityFeignClient {


    /**
     * 通过 openFeign 访问 Authority 获取 token
     */
    @RequestMapping(value = "/wj-code-authority-center/authority/token",
            method = RequestMethod.POST, consumes = "application/json", produces = "application/json")
    JwtToken getTokenByFeign(@RequestBody UsernameAndPassword usernameAndPassword);
}
